Correct order of Icon, Label, Line styles in KML writer.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 11 Oct 2010 13:51:41 +0000 (13:51 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 11 Oct 2010 13:51:41 +0000 (13:51 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4035 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/kml.c
gpsbabel/reference/earth-expertgps-track.kml
gpsbabel/reference/earth-expertgps.kml
gpsbabel/reference/track/gpx_garmin_extensions-kml_track.kml
gpsbabel/reference/track/gtrnctr_power-kml.kml
gpsbabel/reference/track/segmented_tracks-track.kml
gpsbabel/reference/track/segmented_tracks.kml

index e7285c721d17634045f90e637ebdaeee9c65fc9e..aabf9ffe46cca1bf49d1fd13d2ce27fca2c7859b 100644 (file)
@@ -466,18 +466,6 @@ static void kml_write_bitmap_style_(const char *style, const char * bitmap,
                highlighted ? "Highlighted" : "Normal", style);
        kml_write_xml(1, "<Style id=\"%s_%c\">\n", style, hovertag(highlighted));
 
-       if (is_multitrack) {
-               kml_output_linestyle(opt_line_color,
-                                     highlighted ? line_width + 2 :
-                                                   line_width);
-        }
-
-       if (is_track && !highlighted) {
-               kml_write_xml(1, "<LabelStyle>\n");
-               kml_write_xml(0, "<scale>0</scale>\n");
-               kml_write_xml(-1, "</LabelStyle>\n");
-       }
-
        kml_write_xml(1, "<IconStyle>\n");
        if (highlighted) {
                kml_write_xml(0, "<scale>1.2</scale>\n");
@@ -494,6 +482,19 @@ static void kml_write_bitmap_style_(const char *style, const char * bitmap,
        kml_write_xml(0, "<href>%s</href>\n", bitmap);
        kml_write_xml(-1, "</Icon>\n");
        kml_write_xml(-1, "</IconStyle>\n");
+
+       if (is_track && !highlighted) {
+               kml_write_xml(1, "<LabelStyle>\n");
+               kml_write_xml(0, "<scale>0</scale>\n");
+               kml_write_xml(-1, "</LabelStyle>\n");
+       }
+
+       if (is_multitrack) {
+               kml_output_linestyle(opt_line_color,
+                                     highlighted ? line_width + 2 :
+                                                   line_width);
+        }
+
        kml_write_xml(-1, "</Style>\n");
 }
 
index 597948f083843df3baf5c3b879f7746da7de8560..8b9f8d10f0a50d0e93ebc3036bab8b0b6adac5c0 100644 (file)
     </StyleMap>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">
     </StyleMap>
 <!-- Normal multiTrack style -->
     <Style id="multiTrack_n">
-      <LineStyle>
-        <color>99ffac59</color>
-        <width>6</width>
-      </LineStyle>
       <IconStyle>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
-    </Style>
-<!-- Highlighted multiTrack style -->
-    <Style id="multiTrack_h">
       <LineStyle>
         <color>99ffac59</color>
-        <width>8</width>
+        <width>6</width>
       </LineStyle>
+    </Style>
+<!-- Highlighted multiTrack style -->
+    <Style id="multiTrack_h">
       <IconStyle>
         <scale>1.2</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
+      <LineStyle>
+        <color>99ffac59</color>
+        <width>8</width>
+      </LineStyle>
     </Style>
     <StyleMap id="multiTrack">
       <Pair>
index 789678233d50da9320d0a76daf2a9b97318a5cef..e38b0f4481718821143ed0dc69594ddeaf714746 100644 (file)
     </StyleMap>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">
index 4d94bd15f2a1fb911040fdbebd8af23670415133..c7eccb06dbab50e5f7fd8c531708af245cbd6a87 100644 (file)
     </Schema>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">
     </StyleMap>
 <!-- Normal multiTrack style -->
     <Style id="multiTrack_n">
-      <LineStyle>
-        <color>99ffac59</color>
-        <width>6</width>
-      </LineStyle>
       <IconStyle>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
-    </Style>
-<!-- Highlighted multiTrack style -->
-    <Style id="multiTrack_h">
       <LineStyle>
         <color>99ffac59</color>
-        <width>8</width>
+        <width>6</width>
       </LineStyle>
+    </Style>
+<!-- Highlighted multiTrack style -->
+    <Style id="multiTrack_h">
       <IconStyle>
         <scale>1.2</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
+      <LineStyle>
+        <color>99ffac59</color>
+        <width>8</width>
+      </LineStyle>
     </Style>
     <StyleMap id="multiTrack">
       <Pair>
index 2b893313bde15ae7c56cb5a4328978fc9605bde5..56961d9e9aedaf32cb5fc26e3b862fa437cea760 100644 (file)
     </Schema>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">
     </StyleMap>
 <!-- Normal multiTrack style -->
     <Style id="multiTrack_n">
-      <LineStyle>
-        <color>99ffac59</color>
-        <width>6</width>
-      </LineStyle>
       <IconStyle>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
-    </Style>
-<!-- Highlighted multiTrack style -->
-    <Style id="multiTrack_h">
       <LineStyle>
         <color>99ffac59</color>
-        <width>8</width>
+        <width>6</width>
       </LineStyle>
+    </Style>
+<!-- Highlighted multiTrack style -->
+    <Style id="multiTrack_h">
       <IconStyle>
         <scale>1.2</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
+      <LineStyle>
+        <color>99ffac59</color>
+        <width>8</width>
+      </LineStyle>
     </Style>
     <StyleMap id="multiTrack">
       <Pair>
index 90b0f0288ad29c2fa45bb19384f4147e74edc398..4134808d679129292706da5a2c5809f58d440d98 100644 (file)
@@ -5,15 +5,15 @@
     <name>GPS device</name>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">
     </StyleMap>
 <!-- Normal multiTrack style -->
     <Style id="multiTrack_n">
-      <LineStyle>
-        <color>99ffac59</color>
-        <width>6</width>
-      </LineStyle>
       <IconStyle>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
-    </Style>
-<!-- Highlighted multiTrack style -->
-    <Style id="multiTrack_h">
       <LineStyle>
         <color>99ffac59</color>
-        <width>8</width>
+        <width>6</width>
       </LineStyle>
+    </Style>
+<!-- Highlighted multiTrack style -->
+    <Style id="multiTrack_h">
       <IconStyle>
         <scale>1.2</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
         </Icon>
       </IconStyle>
+      <LineStyle>
+        <color>99ffac59</color>
+        <width>8</width>
+      </LineStyle>
     </Style>
     <StyleMap id="multiTrack">
       <Pair>
index 9066532b86d9f6a14e9b21b0a5f5f8332cb28499..e58bc4a51b2af8fedc25ad2c4c43647a687d0b62 100644 (file)
@@ -5,15 +5,15 @@
     <name>GPS device</name>
 <!-- Normal track style -->
     <Style id="track_n">
-      <LabelStyle>
-        <scale>0</scale>
-      </LabelStyle>
       <IconStyle>
         <scale>.5</scale>
         <Icon>
           <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
         </Icon>
       </IconStyle>
+      <LabelStyle>
+        <scale>0</scale>
+      </LabelStyle>
     </Style>
 <!-- Highlighted track style -->
     <Style id="track_h">